<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<link rel="stylesheet" href="main.css">

		<title>2-3 媒体查询引入方式</title>

		<style>

			* {
				margin: 0;
				padding: 0;
				box-sizing: border-box;
			}

			.contanier {
				width: 100%;
			}

			.contanier .box {
				float: left;
			}

			.box {
				width: 100%;
				height: 150px;
				border: 1px solid #444;

			}


			/* 清除浮动 */
			.clearfix:before,
			.clearfix::after {
				content: '';
				display: block;
				clear: both;

			}


			.contanier .box:nth-child(1) {
				background-color: rgb(80, 0, 0);

			}

			.contanier .box:nth-child(2) {
				background-color: rgb(120, 0, 0);

			}

			.contanier .box:nth-child(3) {
				background-color: rgb(160, 0, 0);

			}

			
		</style>
		
		
		<style media="(min-width:400px)">
			
			/* 浏览器宽度 范围在这里的时候   >=400px 
			 1行 三个div 
			 */
			.box {
				width: 33.3%;
			}
	
		</style>
	
	
		
		<style media="(min-width:300px) and (max-width:399px)">
			/* 浏览器宽度 范围在这里的时候
			 2行 三个div 
			 */
			
			.box {
				width: 50%;
			}
			
			
		</style>
		

		<style media="(min-width:200px) and (max-width:299px)">
			
			/* 浏览器宽度 范围在这里的时候
			 3行 三个div 
			 */
		
			.box {

				width: 100%;
			}
			
		</style>
	
	</head>
	<body>

		<div class="contanier clearfix">

			<div class="box">1</div>
			<div class="box">2</div>
			<div class="box">3</div>

		</div>


	</body>
</html>
